class Feed::OrderItemCreatedAndSpotsOrdered < Feed
  
  validates :order_id,
    :order_item_id,
    :presence => true  
    
  def code
    ActiveSupport::StringInquirer.new('spots_ordered')
  end

  def furniture_logistic_stat_order_items_desc
    order_item.furniture_logistic_stat_order_items.each_with_object([]) do |stat_order_item,descs|
      descs << "【#{stat_order_item.furniture_logistic_stat.dept.name} => (#{stat_order_item.furniture.spec})*#{stat_order_item.ordered_count}件】"
    end.join(',')
  end
  
  def short_desc
    "顾客于#{order.ordered_on}在#{order.dept.name}<b>预订现货</b>#{furniture_logistic_stat_order_items_desc}"
  end
  
  def remark
    order_item.remark
  end
end